import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//引入element ui 组件库
import ElementUI from 'element-ui'; 
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
//引入axios组件
import axios from 'axios'
import VueAxios from 'vue-axios';
axios.defaults.baseURL = "http://8.136.106.157:8888"
Vue.use(VueAxios,axios)

import qs from "qs"
import moment from "moment"
Vue.prototype.moment=moment


import VueAMap from 'vue-amap'
Vue.use(VueAMap);
// 初始化vue-amap
VueAMap.initAMapApiLoader({
	key: "d4d91e614a04dac0fb4c14c7064ef63e",// 高德的key
	// 插件集合
	plugin: [

		'AMap.CircleEditor',// 圆形编辑器插件
		"AMap.Geolocation", // 定位控件，用来获取和展示用户主机所在的经纬度位置
		"AMap.Geocoder", // 地理编码与逆地理编码服务，用于地址描述与坐标间的相互转换
		"AMap.Autocomplete",
		"AMap.PlaceSearch",
		"AMap.CitySearch",
	],
	// 高德 sdk 版本，默认为 1.4.4
	v: '1.4.4'
});
//高德的安全密钥
window._AMapSecurityConfig = {
	securityJsCode:"6082948bb07a123de87fc03d5f2829fe",
}
Vue.prototype.noShake = function (num){
	if (!this.time) {
        let that=this
        that.time =num; //设定间隔时间（秒）
		that.disabled=true;
        //启动计时器，倒计时time秒后自动关闭计时器。
        let index = setInterval(function(){
            that.time--;
            
            if (!that.time) {
                clearInterval(index);
                that.time=''
				that.disabled=false
            }
        }, 1000);
 		//此处可写要执行的代码
        console.log('按钮事件被触发');
    }else{
        console.log('目前按钮事件不允许被触发');
    }
  }

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
